package com.codegeek.project.slope.domain;

import com.codegeek.common.utils.ReplaceIllegalChar;
import com.codegeek.framework.aspectj.lang.annotation.Excel;
import com.codegeek.framework.web.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 告警记录对象 slope_alarm
 *
 * @author codegeek
 * @date 2020-02-17
 */
@Data
public class SlopeAlarm extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    private Long alarmId;

    /**
     * 告警时间
     */
    @Excel(name = "告警时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date alarmTime;

    /**
     * 告警项
     */
    @Excel(name = "告警项")
    private Long alarmItem;

    /**
     * 告警值
     */
    @Excel(name = "告警值")
    private Float alarmValue;

    /**
     * 告警等级
     */
    @Excel(name = "告警等级")
    private Integer alarmLevel;

    /**
     * 告警状态
     */
    @Excel(name = "告警状态")
    private Integer alarmState;

    /**
     * 当前告警阈值
     */
    @Excel(name = "当前告警阈值")
    private Float alarmThreadhold;

    @Excel(name = "告警传感器ID")
    private Long alarmSensorId;

    /**
     * 告警传感器
     */
    @ApiModelProperty(required = false, hidden = true)
    private SlopeSensor alarmSensor;

    @ApiModelProperty(required = false, hidden = true)
    private SlopeMonitorItem monitorItem;

    private Integer sensorType;

    private String deviceName;

    public void setDeviceName(String deviceName) {
        this.deviceName = new ReplaceIllegalChar().replace(deviceName);
    }
}
